/// id : 185
/// teamSize : 2
/// productQuantity : 60.0
/// productPrice : 10.0
/// singleQuantity : 0.0
/// workDate : "2024-11-06"
/// user : {"id":1,"username":"HHH","phone":"16650518753","status":0}

class DayWorkRecord {
  DayWorkRecord({
    int? id,
    int? teamSize,
    double? productQuantity,
    double? productPrice,
    double? singleQuantity,
      String? workDate, 
      User? user,}){
    _id = id;
    _teamSize = teamSize;
    _productQuantity = productQuantity;
    _productPrice = productPrice;
    _singleQuantity = singleQuantity;
    _workDate = workDate;
    _user = user;
}

  DayWorkRecord.fromJson(dynamic json) {
    _id = json['id'];
    _teamSize = json['teamSize'];
    _productQuantity = json['productQuantity'];
    _productPrice = json['productPrice'];
    _singleQuantity = json['singleQuantity'];
    _workDate = json['workDate'];
    _user = json['user'] != null ? User.fromJson(json['user']) : null;
  }
  int? _id;
  int? _teamSize;
  double? _productQuantity;
  double? _productPrice;
  double? _singleQuantity;
  String? _workDate;
  User? _user;
DayWorkRecord copyWith({  int? id,
  int? teamSize,
  double? productQuantity,
  double? productPrice,
  double? singleQuantity,
  String? workDate,
  User? user,
}) => DayWorkRecord(  id: id ?? _id,
  teamSize: teamSize ?? _teamSize,
  productQuantity: productQuantity ?? _productQuantity,
  productPrice: productPrice ?? _productPrice,
  singleQuantity: singleQuantity ?? _singleQuantity,
  workDate: workDate ?? _workDate,
  user: user ?? _user,
);
  int? get id => _id;
  int? get teamSize => _teamSize;
  double? get productQuantity => _productQuantity;
  double? get productPrice => _productPrice;
  double? get singleQuantity => _singleQuantity;
  String? get workDate => _workDate;
  User? get user => _user;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['id'] = _id;
    map['teamSize'] = _teamSize;
    map['productQuantity'] = _productQuantity;
    map['productPrice'] = _productPrice;
    map['singleQuantity'] = _singleQuantity;
    map['workDate'] = _workDate;
    if (_user != null) {
      map['user'] = _user?.toJson();
    }
    return map;
  }

}

/// id : 1
/// username : "HHH"
/// phone : "16650518753"
/// status : 0

class User {
  User({
      num? id, 
      String? username, 
      String? phone, 
      num? status,}){
    _id = id;
    _username = username;
    _phone = phone;
    _status = status;
}

  User.fromJson(dynamic json) {
    _id = json['id'];
    _username = json['username'];
    _phone = json['phone'];
    _status = json['status'];
  }
  num? _id;
  String? _username;
  String? _phone;
  num? _status;
User copyWith({  num? id,
  String? username,
  String? phone,
  num? status,
}) => User(  id: id ?? _id,
  username: username ?? _username,
  phone: phone ?? _phone,
  status: status ?? _status,
);
  num? get id => _id;
  String? get username => _username;
  String? get phone => _phone;
  num? get status => _status;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['id'] = _id;
    map['username'] = _username;
    map['phone'] = _phone;
    map['status'] = _status;
    return map;
  }

}